// src/features/workspaces/api/use-current-member.ts
import {MARK_DATA_URL} from "@/lib/social/constants";

export const useCurrentMember = async ({workspaceId, userId}: { workspaceId: string, userId?: string }) => {
    console.log('use current member', workspaceId, userId);

    const res = await fetch(
        // `${MARK_DATA_URL}/members?workspaceId=${workspaceId}&userId=${userId}`,
        `/api/members?workspaceId=${workspaceId}&userId=${userId}`,
    )
    let data = await res.json()
    data = data[0]
    const isLoading = data === undefined

    return {data, isLoading}
}